package com.lovo.traffic;

/**
 * 交警类
 */
public class Police {
    private String no;
    private String name;
    public Police(){}
    public Police(String no,String name){
        this.no = no;
        this.name = name;
    }
    /**
     * 处罚
     */
    public void pay(Driver driver,Car car,Rule rule){
        System.out.println("驾驶员"+driver.name
                            +"在"+rule.road
                            +"驾驶车辆"+car.color+"的"+car.type
                            +"因为"+rule.ruleInfo+"违章"
                            +"被扣"+rule.score
                            +"罚款"+rule.money
                            +"，交警："+this.name);
    }
}
